import { createSlice } from "@reduxjs/toolkit";

const avatarSlice = createSlice({
    name: 'avatarModule',
    initialState: {
        avatar:localStorage.user?JSON.parse(localStorage.user).avatar:''
    },
    reducers: {
        changeAvatar(state, action) {
            state.avatar = action.payload
        }
    }
})
export const {changeAvatar} = avatarSlice.actions 
export default avatarSlice.reducer